﻿<Window x:Class="DemoWPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DemoWPF"
        
        Title="UndoRedo Demo"
        Height="300" Width="240">
	
	<Window.DataContext>
		<local:Model/>
	</Window.DataContext>
	
	<DockPanel>
		
		<ToolBarTray DockPanel.Dock="Top">
			<ToolBar>
				
				<Button Command="{Binding AddNewCommand}">Add new</Button>
				<Button Command="{Binding RemoveCommand}">Remove</Button>
				<Button Command="{Binding UndoCommand}">Undo</Button>
				<Button Command="{Binding RedoCommand}">Redo</Button>
			
			</ToolBar>
		</ToolBarTray>
		
		<DockPanel DataContext="{Binding View}">
			
			<TextBox DockPanel.Dock="Bottom"
			         Text="{Binding /Text}"/>
			
			<ListBox ItemsSource="{Binding}"
			         DisplayMemberPath="Text"/>
		
		</DockPanel>
	</DockPanel>
</Window>